<?php use_helper('Validation','Object', 'ObjectAdmin') ?>

<?php use_stylesheet('/sf/sf_admin/css/main') ?>
<h1>User Profile</h1>

<?php echo form_tag('@edituser', array(
  'id'        => 'edit_form',
  'name'      => 'edit_form',
  'multipart' => true,
  'onsubmit'  => 'double_list_submit("edit_form"); return true;'
)) ?>
<label>Email</label>
<?php echo $sf_user->getGuardUser()->getUsername(); ?><br /><br />
<label>Password</label>
<?php echo "******** [" . link_to('edit password','@editpassword') ."]" ?><br /><br />
<label>First Name</label>
<?php echo form_error('firstname') ?>
<?php echo input_tag('firstname',$sf_params->get('firstname',$tutor[0]->getFirstName())) ?><br /><br />
<label>Last Name</label>
<?php echo form_error('lastname') ?>
<?php echo input_tag('lastname',$sf_params->get('lastname',$tutor[0]->getLastName())) ?><br /><br />
<label>Rates ($)</label>
<?php echo form_error('rates') ?>
<?php echo input_tag('rates',$sf_params->get('rates',$tutor[0]->getRates())); ?><br /><br />
<label>Additional Info</label>
<?php echo form_error('additionalinfo') ?>
<?php echo textarea_tag('additionalinfo',$sf_params->get('additionalinfo',$tutor[0]->getAdditionalInfo()),'size=50x5'); ?><br /><br />
<label>Availability</label>
<?php echo object_admin_double_list($tutor[0], 'getAvailabilities', array('control_name' => 'tutor[availabilities]', 'through_class' => 'AvailabilityTutor')) ?>
<br /><br />
<label>Service Area</label>
<?php echo form_error('servicearea') ?>
<?php echo select_tag('servicearea', objects_for_select($serviceareas,'getId','getName',$sf_params->get('servicearea',$servicearea))) ?>
<br /><br />
<label>Subjects</label>
<?php echo object_admin_double_list($tutor[0], 'getSubjects', array('control_name' => 'tutor[subjects]', 'through_class' => 'SubjectTutor')) ?>

<br /><br />
<?php echo submit_tag('Submit') ?>
</form>